<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../lib/vue.js"></script>
</head>
<body>
    <div id="root">
        <!-- 修饰符trim:去除左右空格    -->
        <label>
            <input v-model.trim="str" type="text">
        </label>
        <h3>青龙{{str}}白虎</h3>

        <!-- 修饰符number:类型保持为number    -->
        <label>
            <input type="text" v-model.number="a">
        </label>+
        <label>
            <input type="text" v-model.number="b">
        </label>
        <button @click="sum=a+b">=</button>
        <label>
            <input v-model="sum" type="text">
        </label>

        <!-- 修饰符lazy:当失去焦点之后数据才会进行改变。-->
        <label>
            <input v-model.lazy="str" type="text">
        </label>
        <h3>{{str}}</h3>
        <h3>{{str}}</h3>
        <h3>{{str}}</h3>
        <h3>{{str}}</h3>
        <h3>{{str}}</h3>
        <h3>{{str}}</h3>
    </div>
</body>
<script>
    new Vue({
        el: "#root",
        data: {
            str: "蔡徐坤",
            a: 1,
            b: 2,
            sum: 3
        }
    })
</script>
</html>